<?php
/*
	挪车卡概况
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return['htmls']=array();
	//挪车卡使用统计
	$card['wait']=pdo_count('jy_move_agentcar_cards',array('uniacid'=>$_SESSION['uniacid'],'mid'=>0));
	$card['ing']=pdo_count('jy_move_agentcar_cards',array('uniacid'=>$_SESSION['uniacid'],'mid >'=>0));
	$return['htmls'][]=array('type'=>'echarts_pie','one_num'=>2,'width'=>'50%','ecid'=>'card','title'=>'挪车卡使用情况统计','datas'=>array(
					'time' => date("Y-m-d H:i:s", time()),
					'datas'=>array(
						array('name'=>'待绑定','value'=>$card['wait']),
						array('name'=>'已绑定','value'=>$card['ing']),
					),
				));
	//场景分类统计
	$scenes=pdo_fetchall('select remark as name,count(*) as value from '.tablename('jy_move_agentcar_cards').' where uniacid='.$_SESSION['uniacid'].' group by remark');
	//print_r($scenes);exit;
	if($scenes){
		$return['htmls'][]=array('type'=>'echarts_pie','one_num'=>2,'width'=>'50%','ecid'=>'scene','title'=>'场景分类统计','datas'=>array(
						'time' => date("Y-m-d H:i:s", time()),
						'datas'=>$scenes,
		));
	}
	
	
	exi($return);
}